import { createVuePlugin } from 'vite-plugin-vue2'
import { resolve } from 'path'
// import { fileURLToPath, URL } from 'node:url'

// vite.config.js
export default {
  base: './',
  publicDir: 'docsPublic',
  server: {
    port: 8082,
    host: '0.0.0.0',
    proxy: {}
  },
  plugins: [createVuePlugin()],
  resolve: {
    extensions: ['.vue', '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
    alias: {
      // vue2项目别名一般都是@，vue3中一般使用/@/, 为方便使用
      '@': resolve('./src'),
      '@C': resolve('./src/compontent'),
      '@UI': resolve('./src/compontent/UI'),
      '@libs': resolve('./src/libs'),
    }
  },
  build: {
    assetsInlineLimit: 2048,
    outDir: './dist/doc',
  },
}